package cn.itcast.dao;

import cn.itcast.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {

    @Select("select * from account")
    List<Account> findAll();

    @Select("select * from account where name=#{name}")
    Account findById(Account account);

    @Insert("insert into account(name,money) values(#{name},#{money})")
    int insert(Account account);

    @Update("update account set money=#{money} where name=#{name}")
    int update(Account account);

    @Delete("delete from account where name=#{name} ")
    int delete(Account account);

}